package com.service.business.merchant.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.service.business.merchant.service.MerchantAuditRecordService;
import com.service.dao.model.MerchantAuditRecord;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.service.dao.mapper.MerchantAuditRecordMapper;


@Service("merchantAuditRecordService")
public class MerchantAuditRecordServiceImpl extends ServiceImpl<MerchantAuditRecordMapper, MerchantAuditRecord> implements MerchantAuditRecordService {

    @Override
    public MerchantAuditRecord getLastAudit(Integer merchantId) {
        return getOne(new QueryWrapper<MerchantAuditRecord>().lambda()
                .eq(MerchantAuditRecord::getMerchantId, merchantId)
                .orderByDesc(MerchantAuditRecord::getCreateTime).last("limit 1"));
    }

}
